package com.smart.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

public class TcpHandler extends ChannelInboundHandlerAdapter {

	@Override
	public void channelRead(ChannelHandlerContext ctx,Object msg) throws Exception{
		Channel incoming = ctx.channel();
		String body = (String) msg;
		System.out.println("原始报文-------"+incoming.remoteAddress().toString()+"----"+body);
		MyTools myTools = new MyTools();
		myTools.writeToClient("1002050a840336010102328002021003", ctx,"测试",incoming.remoteAddress().toString());
	}
}